package com.vigor.bear.web.service.impl;

import java.util.List;

import com.vigor.bear.web.bean.QueryModel;
import com.vigor.bear.web.bean.Role;
import com.vigor.bear.web.dao.RoleMapper;
import com.vigor.bear.web.service.RoleService;

import org.apache.ibatis.session.RowBounds;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 角色业务实现
 * 
 * @author Alan
 */
@Service
public class RoleServiceImpl implements RoleService {

    @Autowired
    private RoleMapper roleMapper;

    public int create(Role role) {
        return roleMapper.create(role);
    }

    public int update(Role role) {
        return roleMapper.update(role);
    }

    public int delete(int rid) {
        return roleMapper.delete(rid);
    }

    public Role get(int rid) {
        return roleMapper.get(rid);
    }

    public List<Role> all() {
        return roleMapper.all();
    }

	@Override
	public int deleteSelect(String[] rids) {
		return roleMapper.deleteSelect(rids);
	}

	@Override
	public Role find(String role) {
		return roleMapper.find(role);
	}

	@Override
	public List<Role> all(RowBounds pagination, String sSearch) {
		return roleMapper.all(pagination, sSearch);
	}

	@Override
	public List<Role> all(QueryModel queryModel) {
		return roleMapper.all(queryModel.getPagination(), queryModel.getsSearch());
	}

}
